<?php

/**
 * Participation form base class.
 *
 * @package    form
 * @subpackage participation
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseParticipationForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'recepient_id'      => new sfWidgetFormDoctrineSelect(array('model' => 'Recepient', 'add_empty' => false)),
      'batch_id'          => new sfWidgetFormDoctrineSelect(array('model' => 'Batch', 'add_empty' => false)),
      'status'            => new sfWidgetFormChoice(array('choices' => array('Pending' => 'Pending', 'Started' => 'Started', 'Grown' => 'Grown', 'Processed' => 'Processed', 'Marketed' => 'Marketed', 'Paid' => 'Paid'))),
      'inputdeliverydate' => new sfWidgetFormDate(),
      'comments'          => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorDoctrineChoice(array('model' => 'Participation', 'column' => 'id', 'required' => false)),
      'recepient_id'      => new sfValidatorDoctrineChoice(array('model' => 'Recepient')),
      'batch_id'          => new sfValidatorDoctrineChoice(array('model' => 'Batch')),
      'status'            => new sfValidatorChoice(array('choices' => array('Pending' => 'Pending', 'Started' => 'Started', 'Grown' => 'Grown', 'Processed' => 'Processed', 'Marketed' => 'Marketed', 'Paid' => 'Paid'), 'required' => false)),
      'inputdeliverydate' => new sfValidatorDate(array('required' => false)),
      'comments'          => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('participation[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Participation';
  }

}